<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ page session="true" %>
<script type="text/javascript">
$(document).ready(function(){
	$("#goSave").on("click", function(){
		var val = validation();
		if (Boolean(val)){
			$("#frm").submit();
		}
		return false;
	});
	
});
var validation = function(){
	var boardcategory = $("#boardcategory").val();
	var boardtitle = $("#boardtitle").val();
	var boarddesc = $("#boarddesc").val();
	if (!Boolean(boardcategory)){
		alert("문의유형을 선택해 주세요.");
		return false;
	}
	if (!Boolean(boardtitle)){
		alert("제목을 입력해 주세요.");
		return false;
	}
	if (!Boolean(boarddesc)){
		alert("내용을 입력해 주세요.");
		return false;
	}
	return true;
};
</script>
<!-- 콘텐츠 영역 -->
    <div id="BodyWrap">
        <section>
            <h4 class="pag_title">1:1문의하기</h4>
			<div id="ContentWrap4">
                <section>
                	<h5 class="hidtext" title="주문취소정보 입력">주문취소정보 입력</h5>
                    <ul class="showwindow_list4">
                        <li>
                            <a href="${contextPath}/vhmall/item_detail.vh?prdcd=${orderinfoDetail.PRDCD}" class="thumb">
                                <img src="http://www.vhmall.co.kr/inc/imgLoad.jsp?dirName=product/${orderinfoDetail.CORPNO}/&fileName=${orderinfoDetail.PRDIMG}&thumb=Y&quality=100&size=230" />
                                
                            </a>
                            <div class="windowinfo_area">
                                <a href="${contextPath}/vhmall/item_detail.vh?prdcd=${orderinfoDetail.PRDCD}" class="title">${orderinfoDetail.PRDNM }</a>
                                <p class="price">
                                    <fmt:formatNumber type="number" maxFractionDigits="3" value="${orderinfoDetail.CPNPRC}" var="CPNPRC"/>
	                            	<fmt:formatNumber type="number" maxFractionDigits="3" value="${orderinfoDetail.SELPRC}" var="SELPRC"/>	
	                            	<c:if test="${orderinfoDetail.CPNPRC!=null}">
	                            	
		                                <span class="discount"><em>${SELPRC}</em>원</span>
		                                ${CPNPRC}원
	                                </c:if>
	                                <c:if test="${orderinfoDetail.CPNPRC==null}">
	                                	${SELPRC}원
	                                </c:if>
                                </p>
                            </div>
                        </li>
                    </ul>
                    <div class="item_buytitarea" title="주문정보">주문정보</div>
                    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="item_callist" summary="주문 정보내역">
                    	<colgroup>
                        <col style="width:33%">
                        <col style="width:67%">
                        </colgroup>
                        <tr>
                        	<th>주문일</th>
                            <td class="ta_l">${orderinfoDetail.ORDDT}</td>
                        </tr>
                        <tr>
                        	<th>수량</th>
                            <td class="ta_l">${orderinfoDetail.ORDQTY}개</td>
                        </tr>
                        <tr>
                        	<th>옵션</th>
                            <td class="ta_l">${orderinfoDetail.PRDNONM eq '' ? '없음' : orderinfoDetail.PRDNONM}</td>
                        </tr>
                        <tr>
                        	<th>배송지</th>
                            <td class="ta_l">[${orderinfoDetail.ZIPCODE}] ${orderinfoDetail.DLVADDR1} ${orderinfoDetail.DLVADDR2}</td>
                        </tr>
                        <tr>
                        	<th>주문금액</th>
                        	<fmt:formatNumber type="number" value="${orderinfoDetail.PRDORDPRC}" var="PRDORDPRC"/>
                            <td class="ta_l">${PRDORDPRC}원</td>
                        </tr>
                        <tr>
                        	<th>결제금액</th>
                        	<fmt:formatNumber type="number" value="${orderinfoDetail.STTLPRC}" var="STTLPRC"/>
                            <td class="ta_l">${STTLPRC}원</td>
                        </tr>
                        
                        
                        <tr>
                        	<th>배송비</th>
                        	<fmt:formatNumber type="number" value="${orderinfoDetail.DELIFEE}" var="DELIFEE"/>
                            <td class="ta_l">${DELIFEE}원</td>
                        </tr>
                        <tr>
                        	<th>현재상태</th>
                            <td class="ta_l">${orderinfoDetail.CDNM}</td>
                        </tr>
                        <%-- <tr>
                        	<th>배송여부</th>
                            <td class="ta_l">
                            <c:choose>
								<c:when test="${ orderinfoDetail.ORDSTATCD == 'OD03' }"><span class="ftc_red">${orderinfoDetail.CDNM}</span></c:when>
								<c:when test="${ orderinfoDetail.ORDSTATCD == 'OD04' }"><span class="ftc_blue2">${orderinfoDetail.CDNM}</span></c:when>
								<c:otherwise>${orderinfoDetail.CDNM}</c:otherwise>
							</c:choose>
                            </td>
                        </tr> --%>
                    </table>
                    <div class="item_buytitarea" title="주문정보">주문정보</div>
                    <form action="<c:url value="/mypage/qna_write.vh"/>" id="frm" name="frm" method="post">
                    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="item_callist" summary="주문 정보내역">
                    	<input type="hidden" id="boardtypeid" name="boardtypeid" value="8"/>
                    	<input type="hidden" id="boardtext1" name="boardtext1" value="Noprdcd"/>
                    	<input type="hidden" id="boardtext2" name="boardtext2" value="${orderinfoDetail.ORDNO}"/>
                    
                    	<colgroup>
                        <col style="width:33%">
                        <col style="width:67%">
                        </colgroup>
                        <tr>
                        	<th>주문번호</th>
                            <td class="ta_l">${orderinfoDetail.ORDNO}</td>
                        </tr>
                        <tr>
                        	<th>문의유형</th>
                            <td class="ta_l"> 
                            	<c:set var="str" value="${boardType.BOARDTYPECATEGORY}"/>
								<c:set var="splittedString" value="${fn:split(str, '|')}" />
                            	<select name="boardcategory" id="boardcategory" class="item_option">
                                    <option value="" >선택</option>
                                    <c:forEach var="i" items="${splittedString}">
											<option value="<c:out value="${i}" />"><c:out value="${i}" /></option>
									</c:forEach>
                                </select>
                                
                            </td>
                        </tr>
                        <tr>
                        	<th>제목</th>
                            <td class="ta_l">
								<div class="inpser_box bgbocol_gray">
                                    <p>
                                        <input type="text" name="boardtitle" id="boardtitle" placeholder="" maxlength="100"/>
                                    </p>
                                	<!-- <a href="#" class="btn_delsi1" title="삭제">×</a> -->
                                </div>
                            </td>
                        </tr>
                        <tr>
                        	<th>내용</th>
                            <td class="ta_l"><textarea name="boarddesc" id="boarddesc" class="txtaa_wauto1"></textarea></td>
                        </tr>
                        <tr>
                        	<th>알림 받으실 연락처</th>
                            <td class="ta_l">
                            	<div class="inpser_box bgbocol_gray">
                                    <p>
                                        <input type="text" name="boardmembercellphone" id="boardmembercellphone" value="${orderinfoDetail.PHONENO}">
                                    </p>
                                	<!-- <a href="#" class="btn_delsi1" title="삭제">×</a> -->
                                </div>
                            </td>
                        </tr>
                    </table>
                    </form>
                    <div class="btnposition_itembuy">
                        <div class="btnwline2 btnborline_white">
							<a href="#" class="gradation_white2" title="답변확인">답변확인</a>
						</div>
                        <div class="btnwline2 btnborline_gray">
                            <a href="#" class="gradation_darkgray1" title="문의하기" id="goSave">문의하기</a>
                        </div>
                    </div>
                </section>
            </div>
        </section>
        <!--// 콘텐츠 영역 -->